package com.gao.properties;

import java.util.Properties;
import java.util.Set;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class PropertiesDemo1 {
    /*
            Properties作为集合的使用

            Object setProperty (String key, String value) :类似Map集合的put方法

            String getProperty (String key) :类似Map集 合的get方法

            Set<String> stringPropertyNames() :类似Map是集合的keySet方法

     */
    public static void main(String[] args) {
        Properties properties = new Properties();
        properties.setProperty("username","admin");
        properties.setProperty("password","123456");
        Set<String> strings = properties.stringPropertyNames();
        for (String s : strings) {
            System.out.println(s);
        }
        System.out.println(properties);
        System.out.println(properties.getProperty("username"));

    }
}
